package im.vinci.server.feed.domain.pagecontent;

import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import im.vinci.server.user.domain.UserInfo;
import im.vinci.server.utils.JsonUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by mingjie on 17/4/6.
 */
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class HealthyMotionContent {
    private Long userId;
    private UserInfo userInfo;
    private int steps;
    private float heartRate;
    private long createTime;
    private List<MotionPlay> data;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    public int getSteps() {
        return steps;
    }

    public void setSteps(int steps) {
        this.steps = steps;
    }

    public float getHeartRate() {
        return heartRate;
    }

    public void setHeartRate(float heartRate) {
        this.heartRate = heartRate;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public List<MotionPlay> getData() {
        return data;
    }

    public void setData(List<MotionPlay> data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return JsonUtils.encode(this);
    }

    public static void main(String[] args) {
        MusicFeedContent music = new MusicFeedContent();
//        music.setLyricFile("http://img.xiami.net/lyric/32/122832_1420699243977_8815.lrc");
//        music.setSoundEqualizer(0);
//        music.setSoundEffect(0);
//        music.setArtistId(1805);
//        music.setPlaySeconds(282);
//        music.setSingers("李娜");
//        music.setAlbumName("信天游");
//        music.setSongName("信天游");
//        music.setListenFile("http://m5.file.xiami.com/805/1805/9951/122832_111486_l.mp3?auth_key=4089d84ec6954da075cf4c9cb038c27a-1477440000-0-null");
//        music.setSongId(122832);
//        music.setAlbumLogo("http://img.xiami.net/images/pic/04/04/10114813207m_1.jpg");
//        music.setArtistLogo("http://img.xiami.net/images/artistlogo/15/14213911403115_1.jpg");
//        music.setSongType("xiami");
//        music.setArtist("李娜");
//        music.setAlbumId(9951);
//        music.setPlayCounts(2048);

        MotionPlay motionPlay1 = new MotionPlay();
        motionPlay1.setMusic(music);
        motionPlay1.setHeartRate(82.2f);

        MotionPlay motionPlay2 = new MotionPlay();
        motionPlay2.setMusic(music);
        motionPlay2.setHeartRate(80.2f);

        MotionPlay motionPlay3 = new MotionPlay();
        motionPlay3.setMusic(music);
        motionPlay3.setHeartRate(78.2f);

        List<MotionPlay> motionPlayList = new ArrayList<>();
        motionPlayList.add(motionPlay1);
        motionPlayList.add(motionPlay2);
        motionPlayList.add(motionPlay3);

        HealthyMotionContent content = new HealthyMotionContent();
        content.setCreateTime(System.currentTimeMillis());
        content.setHeartRate(80.2f);
        content.setSteps(220);
        content.setData(motionPlayList);

        System.out.println(content);

    }
}
